In some types of semiconductor devices such as High Electron Mobility Transistors (HEMTs), a nitride semiconductor layer grown on a substrate is used in some cases as a semiconductor layer of the device.
However, when the nitride semiconductor layer is grown on the substrate, a residual stress (for example, tensile stress) is created in the nitride semiconductor layer because of a difference of the coefficients of thermal expansion, and a mismatch between the lattice constants of, the nitride semiconductor layer and the substrate on which it is grown. In a nitride semiconductor layer having this residual stress, there is a possibility of defect generation. When the defect exists, even when the HEMT is controlled so that it should be in the off state, occasionally there occurs a leakage current between the source and drain thereof.